package app.maker.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;


/**
 * The persistent class for the ticketHasUser database table.
 * 
 */
@Entity
@Table(name="ticketHasUser")
@NamedQuery(name="TicketHasUser.findAll", query="SELECT t FROM TicketHasUser t")
public class TicketHasUser implements Serializable {
	private static final long serialVersionUID = 1L;
	private int idTicketHasUser;
	private Date date;
	private String etat;
	private byte source;
	private Ticket ticket;
	private User user;

	public TicketHasUser() {
	}


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(unique=true, nullable=false)
	public int getIdTicketHasUser() {
		return this.idTicketHasUser;
	}

	public void setIdTicketHasUser(int idTicketHasUser) {
		this.idTicketHasUser = idTicketHasUser;
	}


	@Temporal(TemporalType.DATE)
	@Column(nullable=false)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}


	@Column(nullable=false, length=20)
	public String getEtat() {
		return this.etat;
	}

	public void setEtat(String etat) {
		this.etat = etat;
	}


	@Column(nullable=false)
	public byte getSource() {
		return this.source;
	}

	public void setSource(byte source) {
		this.source = source;
	}


	//bi-directional many-to-one association to Ticket
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="ticketID", nullable=false)
	public Ticket getTicket() {
		return this.ticket;
	}

	public void setTicket(Ticket ticket) {
		this.ticket = ticket;
	}


	//bi-directional many-to-one association to User
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="userID", nullable=false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}